﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;

namespace LyalinSamples.WP7Client.MaVHubInt
{
    public partial class MaVHubLandPage : PhoneApplicationPage
    {
        public MaVHubLandPage()
        {
            InitializeComponent();
        }

        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            if (this.NavigationContext != null &&
                 this.NavigationContext.QueryString != null &&
                     this.NavigationContext.QueryString.Count > 0)
            {
                MaVAreas MaVArea = (MaVAreas)
                    Enum.Parse(typeof(MaVAreas), this.NavigationContext.QueryString["Area"], false);

                switch(MaVArea)
                {
                    case MaVAreas.History:
                        FromLocationText.Text = "You came from History Items";
                        break;

                    case MaVAreas.New:
                        FromLocationText.Text = "You came from New Items";
                        break;
                    
                    case MaVAreas.NowPlaying:
                        FromLocationText.Text = "You came from Now Playing Item";
                        break;
                }
            }

            base.OnNavigatedTo(e);
        }
    }
}